<script setup lang="ts">
import { h } from "vue";
import { PlusOutlined } from "@ant-design/icons-vue";

defineOptions({
	name: "DataBrowsingAddDataView",
});

const open = ref(false);
const confirmLoading = ref<boolean>(false);
const showModal = () => {
	open.value = true;
};
const handleOk = () => {
	confirmLoading.value = true;
	setTimeout(() => {
		open.value = false;
		confirmLoading.value = false;
	}, 2000);
};
const handleCancel = () => {
	open.value = false;
};
</script>

<template>
	<div class="data-browsing-add-data-view">
		<a-tooltip title="增加" placement="bottom" color="cyan">
			<a-button type="dashed" :icon="h(PlusOutlined)" @click="showModal" />
		</a-tooltip>
		<a-modal
			v-model:open="open"
			title="添加数据"
			:confirm-loading="confirmLoading"
			@ok="handleOk"
			@cancel="handleCancel"
			centered
			width="100%"
			wrap-class-name="full-modal home-add-index"
		/>
	</div>
</template>

<style scoped lang="scss">
.data-browsing-add-data-view {
}
</style>
